package chen.web.widget;


public class WidgetManagerFactory {
	

	private WidgetManager[] managers = null;
	
	public WidgetManagerFactory(WidgetManager ...managers){
		this.managers = managers;
	}
	
	public WidgetManager getWidgetManager(Class<? extends Widget> clazz){
		if(managers == null){
			return null;
		}
		for(WidgetManager manager : managers){
			if(manager.scope(clazz)){
				return manager;
			}
		}
		return null;
	}

}
